<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
  <head><link rel="stylesheet" type="text/css" href="<c:url value='/css/Pub.css'/>"></link>
  	<script type="text/javascript">
  		var path = "${pageContext.request.contextPath}";
  	</script>
  	<script type="text/javascript" src="${pageContext.request.contextPath }/js/car.js"></script>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!-- 如果出现没有效果的情况直接检查是否是因为路径的问题 -->
  <link rel="stylesheet" href="${pageContext.request.contextPath}/easyui/themes/default/easyui.css" type="text/css"></link>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/easyui/themes/icon.css" type="text/css"></link>
  <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.min.js"></script>
  <script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.easyui.min.js"></script>
	<style type="text/css">td {text-align:center}</style>
	  <style type="text/css">
		  a {
			  text-decoration:none;
		  }
	  </style>
	</head>
  <body>
  		<p>以下是你买的所有图书-><font color="red" style="font-family:bold;">订单明细</font>-->选择/添加收货地址->确认订单->网银付款或到货付款->查收货物</p>
  		
  		<table id="table" class="easyui-datagrid" style="width:800px;height:350px"   
        data-options="url:'datagrid_data.json',fitColumns:true,singleSelect:true">   
    <thead>   
        <tr>   
            <th data-options="field:'orderid',width:100">书名</th>   
            <th data-options="field:'orderconsignee',width:150">价格</th>   
            <th data-options="field:'orderamt',width:100">数量</th>   
            <th data-options="field:'orderstate',width:100">合计</th>   
            <th data-options="field:'orderpaytype',width:100">增删数量</th>   
        </tr>   
    </thead>
      <tbody>   
  			<c:set value="0" var="sum"/>
  			<c:forEach items="${sessionScope.car}" var="entry" varStatus="idx">
  				<tr <c:if test="${idx.count%2==0}">class="even"</c:if>>
	  				<td>
	  					<a href="${pageContext.request.contextPath }/index?action=queryBook&id=${entry.value.id}">
	  						${entry.value.name}
	  					</a>
	  				</td>
	  				<td>
	  					${entry.value.currentPrice}
	  				</td>
	  				<td>
	  					${entry.value.amt}
	  				</td>
	  				<td>
	  					<fmt:formatNumber value="${entry.value.currentPrice*entry.value.amt}" pattern="#.##"/>
	  					<c:set value="${sum+(entry.value.currentPrice*entry.value.amt)}" var="sum"/>
	  					<fmt:formatNumber value="${sum}" pattern="#.##" var="sum"/>
	  				</td>
	  				<td>
	  					<input class="oper" type="button"  onclick="_add('${entry.value.id}')" value="+"/>
	  					&nbsp;
	  					<input class="oper" type="button"  onclick="_del('${entry.value.id}')" value="-"/>
	  				</td>
  				</tr>
  			</c:forEach>
  			<tr><td></td><td></td><td></td><td></td>
  				<td data-options="colspan=4">
  					总金额：
  					<label id="sum">
  					${sum}
  					</label>
  					元
  				</td>
  			</tr>
  			<tr>
  			<td></td><td></td><td></td>
  				<td>
  					<button onclick="sure();">下一步->收货地址</button>
  				</td >
  				<td><button  onclick="clearCar();">全部取消</button></td>
  			</tr>
  			</tbody>
  			
  		</table>
  </body>
</html>
